package com.jwsoft.manager.core.gateway.controller;

import com.bifang.engine.protect.core.annotation.Crypto;
import com.jwsoft.manager.common.vo.eduStudentEnroll.EduStudentEnrollVO;
import com.jwsoft.manager.common.vo.eduSyncJhDelete.EduSyncExistInfo;
import com.jwsoft.manager.common.vo.eduSyncJhDelete.EduSyncJhDeleteQueryVO;
import com.jwsoft.manager.core.dao.model.EduStudentEnroll;
import com.jwsoft.manager.core.integration.EduDyjyQuerySyncIntegration;
import com.jwsoft.manager.common.vo.eduDyjyQuerySync.EduDyjyQuerySyncVO;
import com.jwsoft.manager.common.vo.eduDyjyQuerySync.EduDyjyQuerySyncKeyVO;
import com.jwsoft.manager.common.vo.eduDyjyQuerySync.EduDyjyQuerySyncQueryVO;
import com.github.pagehelper.PageInfo;
import com.bifang.engine.assistant.core.domain.AppResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import com.bifang.engine.protect.core.annotation.Idempotent;
import org.springframework.validation.annotation.Validated;
import com.bifang.assistant.common.constants.Validators;

/**
 * 金华录取查询网关
 *
 * @author wangt
 * @since 2024-06-12
 */
@RestController
@RequestMapping(value = "/doc/api")
@Tag(name = "金华录取查询", description = "金华录取查询")
public class EduDyjyQuerySyncController {

    @Autowired
    public EduDyjyQuerySyncIntegration eduDyjyQuerySyncIntegration;

    @Operation(summary = "金华录取查询分页查询",description = "金华录取查询分页查询")
    @PostMapping(value = "/eduDyjyQuerySync0001", produces = "application/json;charset=UTF-8")
    public AppResponse<PageInfo<EduDyjyQuerySyncVO>> getList(@RequestBody @Validated EduDyjyQuerySyncQueryVO vo) {
        return AppResponse.successData(eduDyjyQuerySyncIntegration.getList(vo));
    }

    @Operation(summary = "金华录取查询根据主键查询详情",description = "金华录取查询根据主键查询详情")
    @PostMapping(value = "/eduDyjyQuerySync0002", produces = "application/json;charset=UTF-8")
    public AppResponse<EduDyjyQuerySyncVO> getById(@RequestBody @Validated EduDyjyQuerySyncKeyVO vo) {
        return AppResponse.successData(eduDyjyQuerySyncIntegration.getById(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "金华录取查询新增",description = "金华录取查询新增")
    @PostMapping(value = "/eduDyjyQuerySync0004", produces = "application/json;charset=UTF-8")
    public AppResponse<EduDyjyQuerySyncVO> add(@RequestBody @Validated(value = {Validators.Add.class}) EduDyjyQuerySyncVO vo) {
        return AppResponse.successData(eduDyjyQuerySyncIntegration.add(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "金华录取查询修改",description = "金华录取查询修改")
    @PostMapping(value = "/eduDyjyQuerySync0005", produces = "application/json;charset=UTF-8")
    public AppResponse<EduDyjyQuerySyncVO> edit(@RequestBody @Validated(value = {Validators.Edit.class}) EduDyjyQuerySyncVO vo) {
        return AppResponse.successData(eduDyjyQuerySyncIntegration.edit(vo));
    }

    @Idempotent(expire="PT2S") //2秒内防重复提交
    @Operation(summary = "金华录取查询删除",description = "金华录取查询删除")
    @PostMapping(value = "/eduDyjyQuerySync0006", produces = "application/json;charset=UTF-8")
    public AppResponse del(@RequestBody @Validated EduDyjyQuerySyncKeyVO vo) {
        eduDyjyQuerySyncIntegration.del(vo);
        return AppResponse.successMsg("删除成功！");
    }


    @Operation(summary = "金华市根据类型查询学生信息是否存在",description = "金华市根据类型查询学生信息是否存在")
    @PostMapping(value = "/eduDyjyQuerySync0007", produces = "application/json;charset=UTF-8")
    public AppResponse<EduDyjyQuerySyncVO> querySyncInfo(@RequestBody @Validated EduStudentEnrollVO vo)  {
        return AppResponse.successData(eduDyjyQuerySyncIntegration.querySyncInfo(vo));
    }


}
